<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'incrjsavatar.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body> 
    &lt;This is my JSP page. <br>
    <form action="<%=basePath%>/servlet/IncreaseJSAvatarServlet" method="POST">
    <select name="jsid" id="jaa">
    <option>单击选择</option>
    <%
    	request.setCharacterEncoding("UTF-8");
    	String ss;
    	int a=0;
    	if(request.getParameter("a")!=null){
    	ss = request.getParameter("a");
    	a = Integer.parseInt(ss);
    	}
		Class.forName("com.mysql.jdbc.Driver");
		Connection con = DriverManager.getConnection("jdbc:mysql://localhost/jobs","root","");
		Statement st = con.createStatement();
		ResultSet rs = st.executeQuery("select * from job_assort order by id desc");
		while(rs.next()){
		if(a==rs.getInt("id")){
		%>
		<option value="<%=rs.getInt("id")%>" selected="selected"><%=rs.getString("ja_name")%></option>
		<% }else{%>
				<option value="<%=rs.getInt("id")%>"><%=rs.getString("ja_name")%></option>
			<% }}%>
			<% 
			rs.close();
			st.close();
			con.close();
		%>
    </select>
    赠加一个职位<input type="text" name="jsname" />
    	<input type="submit" value="提交" />
    </form>
  </body>
</html>